package com.projectsexception.festivales;

import java.util.List;

import com.projectsexception.festivales.favorites.model.Favorite;
import com.projectsexception.festivales.setup.ProjectResources;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

public class TabFavoritesActivity extends Activity {
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tab_favorite);        
    }
    
    @Override
    protected void onResume() {
        super.onResume();
        LinearLayout main = (LinearLayout) findViewById(R.id.main_content);
        main.removeAllViews();
        ProjectResources res = ProjectResources.getInstance(this);
        List<Favorite> favorites = res.getFavorites();
        TextView view;
        for (Favorite favorite : favorites) {
            view = new TextView(this);
            view.setText(favorite.getShowInfo().getBand().getName());
            main.addView(view);
        }
    }
}
